﻿using System;
using System.Web.UI.WebControls;
using HiSun.BLL;
using HiSun.Model;

namespace HiSun.Web
{
    public partial class Controls_TopGroupsControl : System.Web.UI.UserControl
    {
        private string controlStyle;
        protected string ControlStyle
        {
            get { return controlStyle; }
        }

        // Get properties based on control consumer
        protected void GetControlStyle()
        {
            if (Request.ServerVariables["SCRIPT_NAME"].ToLower().IndexOf("default.aspx") > 0)
                controlStyle = "navigationLinks";
            else
                controlStyle = "mainNavigation";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            BindGroups();
            Response.Write("haha:" + Request.ServerVariables["SCRIPT_NAME"].ToString());
        }
        private void BindGroups()
        {
            Group group = new Group();
            rptTopGroups.DataSource = group.GetTopGroups(GroupType.Class);
            rptTopGroups.DataBind();
        }
    }
}